package com.sky.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.sky.dto.ShopOrderRequestDTO;
import com.sky.mapper.ShopOrderMapper;
import com.sky.result.PageResult;
import com.sky.service.ShopOrderService;
import com.sky.vo.ShopOrderVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ShopOrderServiceImpl implements ShopOrderService {
    @Autowired
    private ShopOrderMapper shopOrderMapper;

    @Override
    public PageResult list(ShopOrderRequestDTO shopOrderRequestDTO) {
        PageHelper.startPage(shopOrderRequestDTO.getPage(),shopOrderRequestDTO.getPageSize());
        Page<ShopOrderVO> page = shopOrderMapper.list(shopOrderRequestDTO);
        return new PageResult(page.getTotal(),page.getResult());
    }
}
